package com.cby.android.base.contentprovider

import android.os.Bundle

/**
 * @description: ContentProviderHandler
 *
 * @author ChenBaoyang
 * @date 2021/10/13 20:14
 */
class ContentProviderHandler {

    private object SingletonHolder {
        /**
         * 返回InitManager对象
         */
        val instance = ContentProviderHandler()
    }


    companion object {
        val instance = SingletonHolder.instance

        private const val TAG = "ContentProviderHandler"
    }

    /**
     * 提供给content provider调用
     * @param method String
     * @param arg String?
     * @param extras Bundle?
     * @return Bundle?
     */
    fun doCall(method: String, arg: String?, extras: Bundle?): Bundle?{
        //获取用户信息
        val result = Bundle()
        if(method == "test") {
            result.putString("key", "test = $arg")
        }else{
            result.putString("key", "default = $arg")
        }
        return result
    }
}